#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
using namespace std;

class Solution
{
public:
    int countKeyChanges(string s)
    {
        int ans = 0;
        for (int i = 1; i < s.size(); i++)
        {
            if (tolower(s[i - 1]) != tolower(s[i]))
            {
                ans++;
            }
        }
        return ans;
    }
};

int main()
{
    string s = "aAbBcC";
    Solution solution;
    int result = solution.countKeyChanges(s);

    cout << "countKey = " << result << endl;

    return 0;
}